/*
 *  Path.cpp
 *  EidoTron
 *
 *  Created by Luca Di Franco on 10/03/11.
 *  Copyright 2011 Luca Di Franco. All rights reserved.
 *
 */

#include "Path.h"

#include <stdlib.h>
#include <string>

using std::string;

const char* Path::getPathForResource(const char* fileName)
{
	#ifdef __APPLE__
		string pathString = "EidoTron.app/Contents/Resources/";
	#else
		string pathString = "Resources";
	#endif
	char* relativePath = (char*) pathString.c_str();
	strcat(relativePath, fileName);
	char* absolutePath = new char[1024];
	getwd(absolutePath);
	strcat(absolutePath, relativePath);
	return (const char*)absolutePath;
}